/**
 * 
 */
package org.assembly.fenrir.managers;

import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.assembly.fenrir.model.student.Student;

/**
 * @author emanuel
 *
 */
public class StudentsManager {
	
	private Map<Long, Student> students = new HashMap<Long, Student>();
	
	private Student newStudent;
	
	private Long key = 1l;
	
	public Student getNewStudent() {
		if (newStudent == null) {
			newStudent = new Student();
		}
		return newStudent;
	}
	
	public void setNewStudent(Student newStudent) {
		this.newStudent = newStudent;
	}
	
	public void insert() {
		students.put(key, newStudent);
		key++;
		newStudent = null;
	}
	
	public Map<Long, Student> getStudents() {
		return students;
	}
	
	public Collection<Student> getStudentsList() {
		return students.values();
	}

}
